package cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.controller;

import cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.entity.Reward;
import cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.service.RewardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class RewardController {
    @Autowired
    private RewardService rewardsService;
    @PostMapping("rewards")
    public String save(@RequestBody Reward reward) {
        return rewardsService.save(reward);
    }
    @PutMapping("rewards")
    public String update(@RequestBody Reward reward) {
        return rewardsService.update(reward);
    }
}
